-- Workspace SandSim ------------------------------

workspace "SandSim"
	architecture "x64"
	startproject "SandBox"
	
	configurations
	{
		"Debug",
		"Release"
	}

	flags
	{
		"MultiProcessorCompile"
	}

outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"

IncludeDir = {}
IncludeDir["SFML"] = "SandSim/ref/SFML/include"

-- SandSim --

project "SandSim"
	location "SandSim"
	kind "ConsoleApp"
	language "C++"
	cppdialect "C++17"
	-- staticruntime "On"
	
	targetdir ("bin/" .. outputdir .. "/%{prj.name}")
	objdir ("bin-int/" .. outputdir .. "/%{prj.name}")

	pchheader "sspch.h"
	pchsource "SandSim/src/sspch.cpp"

	files
	{
		"%{prj.name}/src/**.h",
		"%{prj.name}/src/**.cpp",
	}
	
	defines
	{
		"_CRT_SECURE_NO_WARNINGS",
		"SFML_STATIC"
	}

	includedirs
	{
		"%{prj.name}/src",
		"%{prj.name}/ref/SFML/include",
	}
	
	links
	{
		"opengl32.lib",
		"winmm.lib",
		"ws2_32.lib",
		"gdi32.lib",
		
		"SandSim/ref/SFML/flac.lib",
		"SandSim/ref/SFML/freetype.lib",
		"SandSim/ref/SFML/ogg.lib",
		"SandSim/ref/SFML/openal32.lib",
		
		"SandSim/ref/SFML/vorbisenc.lib",
		"SandSim/ref/SFML/vorbisfile.lib",
		"SandSim/ref/SFML/vorbis.lib",
	}

	filter "configurations:Debug"
		defines "SS_DEBUG"
		runtime "Debug"
		symbols "On"

		links
		{
			"SandSim/ref/SFML/sfml-window-s-d.lib",
			"SandSim/ref/SFML/sfml-system-s-d.lib",
			"SandSim/ref/SFML/sfml-graphics-s-d.lib",
			"SandSim/ref/SFML/sfml-audio-s-d.lib",
			"SandSim/ref/SFML/sfml-network-s-d.lib",
		}

	filter "configurations:Release"
		defines "SS_RELEASE"
		runtime "Release"
		optimize "On"
		
		links
		{
			"SandSim/ref/SFML/sfml-window-s.lib",
			"SandSim/ref/SFML/sfml-system-s.lib",
			"SandSim/ref/SFML/sfml-graphics-s.lib",
		}
